In general, handwriting recognition is the ability of a computer to receive and interpret intelligible handwritten input from sources such as paper documents, photographs, touch-screens and other devices. Among various recognition techniques, a complete handwriting recognition system also handles layout analysis, performs correct segmentation into characters and finds the most plausible words. Similarly, optical character recognition (OCR) is the mechanical or electronic conversion of scanned images of typewritten or printed text into machine-encoded text. In handwriting recognition and OCR, the task is to recognize an input, such as a handwritten or printed input (e.g., a handwritten sample or a scanned document), and provide an output of any text encoding, such as a Unicode string, matching the input. The output may also comprise of the formatting and layout based on the input.